package com.example.wenliangjiudian.controller;

import com.example.wenliangjiudian.entity.Customer;
import com.example.wenliangjiudian.service.CustomerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@Controller
public class CustomerController {

    @Autowired
    public CustomerService customerService;

    @RequestMapping("/customer/info")
    public Object list(HttpServletRequest request) {
        List<Customer> customers = customerService.selectAll();

        request.setAttribute("customers", customers);


        return "back/customer_info";
    }
}
